package com.uroad.lib.util.ui;

import android.content.Context;
import android.support.v4.view.ViewPager;

import com.uroad.lib.widget.MyViewPagerScroller;

import java.lang.reflect.Field;


public class ViewPagerUtil {

	/**
	 * Viewpager 切换时动画
	 * **/
	public static void changePagerScroller(ViewPager viewPager, Context mCon) {
		try {
			Field mScroller = null;
			mScroller = ViewPager.class.getDeclaredField("mScroller");
			mScroller.setAccessible(true);
			MyViewPagerScroller scroller = new MyViewPagerScroller(mCon);
			mScroller.set(viewPager, scroller);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
